package com.ziyun.pop.web.api.register;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import io.renren.common.utils.R;
import io.renren.modules.sys.entity.SysUserEntity;
import io.renren.modules.sys.service.SysUserService;

/**
 * 系统登录相关接口
 * 
 * @author zh
 * @date 2018/9/1814:57
 */
@RestController
@RequestMapping("port/sys/")
public class SysRegisterControllerApi {

	@Autowired
	private SysUserService sysUserService;

	/**
	 * 注册账号
	 * 
	 * @param userName
	 * @param password
	 * @return
	 */
	@RequestMapping("/register")
	public R list(@RequestBody Map<String, Object> map) {
		Long sellerId = (Long) map.get("sellerId");
		Long mallUserId = (Long) map.get("mallUserId");
		String username = (String) map.get("sellerName");
		SysUserEntity sysUserEntity = new SysUserEntity();
		sysUserEntity.setSellerId(sellerId);
		sysUserEntity.setMallUserId(mallUserId);
		sysUserEntity.setUsername(username);
		sysUserService.save(sysUserEntity);
		return R.ok();
	}

}
